//
//  MainFootCell.m
//  ZITHER
//
//  Created by weixin on 2018/10/16.
//  Copyright © 2018年 weixn. All rights reserved.
//

#import "MainFootCell.h"
#import "MyEndEnquiryVC.h"

@implementation MainFootCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self setUI];
    
}

-(void)setUI{
    [self addSubview:self.btnEnd];
    [self addSubview:self.labSign];
    [self addSubview:self.labContant];
    [self addSubview:self.labVes];
    [self addSubview:self.signBtn];
    
    
    
    [self.btnEnd mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(25);
        make.centerX.equalTo(self.mas_centerX).offset(0);
        make.width.mas_equalTo(kScreenW-28);
        make.height.mas_equalTo(45);
    }];
    [self.labSign mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.btnEnd.mas_bottom).offset(90);
        make.centerX.equalTo(self).offset(0);
    }];
    [self.labContant mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labSign.mas_bottom).offset(15);
        make.centerX.equalTo(self).offset(0);
    }];
    [self.labVes mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labContant.mas_bottom).offset(15);
        make.centerX.equalTo(self).offset(0);
        make.bottom.equalTo(self).offset(-20);
    }];
    [self.signBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labContant.mas_bottom).offset(15);
        make.centerX.equalTo(self).offset(0);
        make.left.equalTo(self).offset(14);
        make.right.equalTo(self).offset(-14);
        make.height.mas_equalTo(18*2+16);
    }];
    
}

-(void)isLogin:(BOOL)type{
    
    self.signBtn.hidden = type;
}
-(BaseBtn *)btnEnd
{
    if (!_btnEnd) {
        _btnEnd = [[BaseBtn alloc]initializeFrame:CGRectMake(0, 0, 1, 1) NormalText:@"已结束询价" NormalTextColor:[UIColor whiteColor] SeleText:@"" SeleTextColor:nil font:16 isBold:NO];
        [_btnEnd setCornerRadiusWithRadius:7 isMasks:YES];
        @weakify(self);
        [[_btnEnd rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
            @strongify(self);
            [self.getNav pushViewController:[[MyEndEnquiryVC alloc]init] animated:YES];
            NSLog(@"跳转到结束询价页面");
        }];
        _btnEnd.backgroundColor = [UIColor blackColor];
    }
    return _btnEnd;
}
- (UILabel *)labSign{
    if (!_labSign) {
        _labSign = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 1, 1)];
        _labSign.text = RootProjectName;
        _labSign.font = [UIFont fontWithName:@"Helvetica-Bold" size:12];
    }
    return _labSign;
}

- (UILabel *)labContant{
    if (!_labContant) {
        _labContant = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 1, 1)];
        _labContant.text = @"全国专业的腕表社区";
        _labContant.font = [UIFont systemFontOfSize:12];
    }
    return _labContant;
}

- (UILabel *)labVes{
    if (!_labVes) {
        _labVes = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 1, 1)];
        _labVes.text = @"V1.0.0";
        _labVes.font = [UIFont systemFontOfSize:9];
    }
    return _labVes;
}

- (QMUIButton *)signBtn{
    if (!_signBtn) {
        _signBtn = [[QMUIButton alloc]initWithFrame:CGRectMake(0, 0, 1, 1)];
        [_signBtn setCornerRadiusWithRadius:8 isMasks:YES];
        [_signBtn setBorderWithColor:baseColorTheme width:2];
        [_signBtn setTitle:@"" forState:UIControlStateNormal];
        [_signBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _signBtn.backgroundColor = baseColorTheme;
        _signBtn.hidden = YES;
        @weakify(self);
        [[_signBtn rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
            @strongify(self);
           
        }];
    }
    return _signBtn;
}



@end
